<!--
*Author：COCO
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/custom/custom/Base_WorkShop.js此处编写
 -->
<template>
    <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields"
        :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions"
        :table="table" :extend="extend">
    </view-grid>
</template>
<script>
import extend from "@/extension/mass/Mass_Defects.js";
import { ref, defineComponent } from "vue";
export default defineComponent({
    setup() {

        const table = ref({
            key: 'Mass_Defects_ID',
            cnName: '常见缺陷',
            name: 'Mass_Defects',
            url: "/Mass_Defects/",
            sortName: "CreateDate"
        });

        const columns = ref([
            { field: 'Mass_Defects_ID', title: '质量缺陷编号', type: 'int', hidden: true, readonly: true, require: true, align: 'left' },
            { field: 'Mass_Defects_Name', title: '质量缺陷描述', type: 'string', width: 200, link: true, sort: true, require: true, align: 'left', sort: true },
            { field: 'Mass_Defects_Type', title: '质量缺陷类型', type: 'string', width: 120, bind: { key: 'QCDefectType', data: [] }, require: true, align: 'left' },
            { field: 'Mass_Defects_Level', title: '质量缺陷等级', type: 'string', width: 120, bind: { key: 'QCDefectLevel', data: [] }, require: true, align: 'left' },
            { field: 'Mass_Defects_Remark', title: '质量缺陷备注', type: 'string', width: 120, require: true, align: 'left' },

            { field: 'CreateID', title: '创建人编号', type: 'int', width: 120, hidden: true, align: 'left' },
            { field: 'Creator', title: '创建人', type: 'string', width: 120, align: 'left' },
            { field: 'CreateDate', title: '创建时间', type: 'datetime', sort: true, width: 150, align: 'left', sort: true },
            { field: 'ModifyID', title: '修改人编号', type: 'int', width: 120, hidden: true, align: 'left' },
            { field: 'Modifier', title: '修改人', type: 'string', width: 120, align: 'left' },
            { field: 'ModifyDate', title: '修改时间', type: 'datetime', sort: true, width: 150, align: 'left', sort: true }
        ]);


        const detail = ref({
            cnName: "#detailCnName",
            table: "#detailTable",
            columns: [],
            sortName: "",
            key: ""
        });


        const editFormFields = ref({
            "Mass_Defects_Name": "",
            "Mass_Defects_Type": "",
            "Mass_Defects_Level": "",
            "Mass_Defects_Remark": ""
        });


        const editFormOptions = ref([
            [
                { "title": "质量缺陷描述", "required": true, "field": "Mass_Defects_Name", "type": "textarea" }
            ],
            [
                { "dataKey": "QCDefectType", "data": [], "title": "质量缺陷类型", "required": true, "field": "Mass_Defects_Type", "type": "select" }
            ],
            [
                { "dataKey": "QCDefectLevel", "data": [], "title": "质量缺陷等级", "required": true, "field": "Mass_Defects_Level", "type": "select" }
            ],
            [
                { "title": "质量缺陷备注", "field": "Mass_Defects_Remark", "required": true, "type": "textarea" }
            ]
        ]);


        const searchFormFields = ref({ "Mass_Defects_Name": "", "Mass_Defects_Type": "", "Mass_Defects_Level": "" });


        const searchFormOptions = ref([
            [
                { "title": "质量缺陷描述", "field": "Mass_Defects_Name", "type": "like" },
                { "dataKey": "QCDefectType", "data": [], "title": "质量缺陷类型", "field": "Mass_Defects_Type", "type": "select" },
            ],
            [
                { "dataKey": "QCDefectLevel", "data": [], "title": "缺陷等级", "field": "Mass_Defects_Level", "type": "select" },
                { "title": "备注", "field": "Remark", "type": "like" },
            ]
        ]);





        return {
            table,
            extend,
            editFormFields,
            editFormOptions,
            searchFormFields,
            searchFormOptions,
            columns,
            detail,
        };
    },
});
</script>
